/*
 * @Author: JYJ 
 * @Date: 2020-07-11 22:08:58 
 * @Desc: 资源Cache类，加载资源应该从这里取
 */
namespace gf {
    export class ResMgr extends gf.BaseClass {
        public static getInstance(): ResMgr {
            return super.getInstance();
        }
        public async initAsync() {
            await RES.loadConfig("default.res.json", "resource/");
            //await RES.loadConfig("default.res.json", "http://192.168.121.1:8080/mac/resource/");
        }
        /**
         * 加载一组资源
         */
        public async loadGroup(name: string, priority?: number, reporter?: RES.PromiseTaskReporter): Promise<void> {
            return await RES.loadGroup(name, priority, reporter);
        }
        /**
         * 异步加载资源
         */
        public async getResAsync(resName: string): Promise<any> {
            return await RES.getResAsync(resName);
        }
        public unloadRes(resName: string, force?: boolean) {
            RES.destroyRes(resName, force)
        }
    }
}